<?php
namespace App\Model;

class Product extends Model
{
    // 表名
    protected $table = 'products';
    
    // 保护属性
    protected $guarded = [];
    
    // 格式
    protected $casts = [
        'images' => 'array'
    ];
    
    protected $dateFormat = 'U';

    // 等级
    public function level()
    {
        return $this->belongsTo(Level::class, 'level_id');
    }
}